/**
 * ...
 * @author Thot
 */

function RemoveMapCommand(){}; 
POO.extend( RemoveMapCommand, Command );



RemoveMapCommand.prototype.execute = function( p_notificationType, p_data )
{
	var facade = ApplicationFacade.getInstance();
	var appProxy = facade.getProxy( ApplicationProxy.NAME );
	var mapProxy = facade.getProxy( MapProxy.NAME );
	var vo = mapProxy.getMapVOById(appProxy.currentMap);
	var layerVO = null;
	
	var i = vo.layers.length;
	
	
	while( --i > -1 )
	{
		layerVO = vo.layers[i];
		
		appProxy.currentLayer = layerVO.name;
		facade.sendNotification( ApplicationNotification.REMOVE_LAYER, layerVO.name );
	}
	
	mapProxy.removeMapVOById(appProxy.currentMap);
};